<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>
  // 1. 获取body
  var bodyElement = document.body;
  console.log(bodyElement);

  // 2. 获取html
  var htmlElement = document.documentElement;
  console.log(htmlElement);
</script>
</html>